@extends('admin.layouts._menu')
@section('content')
    <div class="card">
        <div class="card-body">
            <ul class="nav nav-tabs nav-overflow header-tabs">
                <li class="nav-item">
                    <a href="{{route('admin.category.index')}}" class="nav-link pb-3 ">
                        分类列表
                    </a>
                </li>
                <li class="nav-item">
                    <a href="{{route('admin.category.edit',$category)}}" class="nav-link pb-3 active">
                        编辑分类
                    </a>
                </li>
            </ul>
        </div>
        <form action="{{route('admin.category.update',$category)}}" method="post">
            @csrf @method ('PUT')
            <div class="card-body">
                <div class="card">
                    <div class="card-header">
                        基本设置
                    </div>
                    <div class="card-body">
                        <div class="form-group">
                            <label>分类名称</label>
                            <input type="text" name="title"  class="form-control"  aria-describedby="helpId" value="{{old('title',$category['title'])}}">
                        </div>
                        <div class="form-group">
                            <label>父级栏目</label>
                            <select name="parent_id" class="form-control">
                                <option value="0">顶级栏目</option>
                                @foreach($categories as $v)
                                    <option value="{{$v['id']}}" {{$v['_disabled']}} {{$v['_selected']}}>
                                        {!! $v['_title'] !!}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="form-group">
                            <label>分类图标</label>
                            <input type="text" name="icon" value="{{old('icon',$category['icon'])}}" class="form-control" placeholder="" aria-describedby="helpId" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-footer text-muted">
                <button class="btn btn-primary btn-sm">保存提交</button>
            </div>
        </form>
    </div>
@endsection
